﻿using IDEAMS.model;
using System.Windows;
using System.Windows.Controls;


namespace IDEAMS.common.control
{
    /// <summary>
    /// DevicePanel.xaml 的交互逻辑
    /// </summary>
    public partial class DevicePanel : UserControl
    {
        public DevicePanel()
        {
            InitializeComponent();
            //this.DataContext = this;
        }

        public DeviceInfoViewModel DeviceInfo
        {
            get
            {
                return (DeviceInfoViewModel)GetValue(DeviceInfoProperty);
            }
            set
            {
                SetValue(DeviceInfoProperty, value);
            }
        }

        public static readonly DependencyProperty DeviceInfoProperty =
            DependencyProperty.Register("DeviceInfo", typeof(DeviceInfoViewModel), typeof(DevicePanel), new PropertyMetadata(null));


        // 定义依赖属性
        public static readonly DependencyProperty IsSelectedProperty =
            DependencyProperty.Register("IsSelected", typeof(bool), typeof(DevicePanel), new PropertyMetadata(false));

        // 依赖属性的CLR包装器
        public bool IsSelected
        {
            get { return (bool)GetValue(IsSelectedProperty); }
            set { SetValue(IsSelectedProperty, value); }
        }
    }
}
